package com.scalar.forecast.forecastEntry.forms;

import com.scalar.forecast.ForecastActionForm;

import java.util.ArrayList;
import java.util.Calendar;

import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * User: Sujan Kumar
 * Date: Feb 11, 2005
 * Time: 11:05:33 AM
 */
public class ForecastEntrySearchForm extends ForecastActionForm
{
    private ArrayList searchFieldList;
    private int custId;
    private int projectId;
    private int productId;
    private int odmId;
    private int startMonth_Quarter_Year;
    private int year;
    private int showNext;

    //The following two properties are used by build forecast search screen.
    private int salesPersonId;
    private String buildNo;

    private boolean showActualValues;
    private boolean showAllSalesPersonsActualValues;

    private String orderBy;

    public ForecastEntrySearchForm()
    {
        searchFieldList = new ArrayList();
        productId = -1;
        custId = -1;
        projectId = -1;
        odmId =-1;
        Calendar now = Calendar.getInstance();
        startMonth_Quarter_Year = now.get( Calendar.MONTH );
        year = now.get( Calendar.YEAR );
        showNext = 0;

        salesPersonId = -1;
        buildNo = null;

        showActualValues = false;
        showAllSalesPersonsActualValues = false;

        orderBy = "";
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public int getCustId() {
        return custId;
    }

    public void setCustId(int custId) {
        this.custId = custId;
    }

    public int getOdmId() {
        return odmId;
    }

    public void setOdmId(int odmId) {
        this.odmId = odmId;
    }

    public int getProjectId() {
        return projectId;
    }

    public void setProjectId(int projectId) {
        this.projectId = projectId;
    }

    public ArrayList getSearchFieldList() {
        return searchFieldList;
    }

    public void setSearchFieldList(ArrayList searchFieldList) {
        this.searchFieldList = searchFieldList;
    }

    public int getShowNext() {
        return showNext;
    }

    public void setShowNext(int showNext) {
        this.showNext = showNext;
    }

    public int getStartMonth_Quarter_Year() {
        return startMonth_Quarter_Year;
    }

    public void setStartMonth_Quarter_Year(int startMonth_Quarter_Year) {
        this.startMonth_Quarter_Year = startMonth_Quarter_Year;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getBuildNo() {
        return buildNo;
    }

    public void setBuildNo(String buildNo) {
        this.buildNo = ( buildNo == null ? null : buildNo.trim() );
    }

    public int getSalesPersonId() {
        return salesPersonId;
    }

    public void setSalesPersonId(int salesPerson) {
        this.salesPersonId = salesPerson;
    }

    public boolean isShowActualValues()
    {
        return showActualValues;
    }

    public void setShowActualValues(boolean showActualValues)
    {
        this.showActualValues = showActualValues;
    }

    public boolean isShowAllSalesPersonsActualValues()
    {
        return showAllSalesPersonsActualValues;
    }

    public void setShowAllSalesPersonsActualValues(boolean showAllSalesPersonsActualValues)
    {
        this.showAllSalesPersonsActualValues = showAllSalesPersonsActualValues;
    }

    public String getOrderBy()
    {
        return orderBy;
    }

    public void setOrderBy( String orderBy )
    {
        this.orderBy = ( orderBy == null ? "" : orderBy.trim() );
    }

    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest)
    {
        searchFieldList = new ArrayList();
        productId=-1;
        custId = -1;
        projectId = -1;
        odmId =-1;
        Calendar now = Calendar.getInstance();
        startMonth_Quarter_Year = now.get( Calendar.MONTH );
        year = now.get( Calendar.YEAR );
        showNext = 0;

        salesPersonId = -1;
        buildNo = null;

        showActualValues = false;
        showAllSalesPersonsActualValues = false;

        orderBy = "";
    }
}
